package com.yk.spark.model;

import javax.persistence.*;

/**
 * Created by Limit on 2017/8/24.
 */
@Entity
@Table(name = "submit", schema = "cykspark", catalog = "")
public class SubmitModel {
    private String submissionId;
    private String action;
    private String message;
    private Boolean success;
    private String serverSparkVersion;

    @Id
    @Column(name = "SUBMISSION_ID")
    public String getSubmissionId() {
        return submissionId;
    }

    public void setSubmissionId(String submissionId) {
        this.submissionId = submissionId;
    }

    @Basic
    @Column(name = "ACTION")
    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    @Basic
    @Column(name = "MESSAGE")
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Basic
    @Column(name = "SUCCESS")
    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    @Basic
    @Column(name = "SERVER_SPARK_VERSION")
    public String getServerSparkVersion() {
        return serverSparkVersion;
    }

    public void setServerSparkVersion(String serverSparkVersion) {
        this.serverSparkVersion = serverSparkVersion;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SubmitModel model = (SubmitModel) o;

        if (submissionId != null ? !submissionId.equals(model.submissionId) : model.submissionId != null) return false;
        if (action != null ? !action.equals(model.action) : model.action != null) return false;
        if (message != null ? !message.equals(model.message) : model.message != null) return false;
        if (success != null ? !success.equals(model.success) : model.success != null) return false;
        if (serverSparkVersion != null ? !serverSparkVersion.equals(model.serverSparkVersion) : model.serverSparkVersion != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = submissionId != null ? submissionId.hashCode() : 0;
        result = 31 * result + (action != null ? action.hashCode() : 0);
        result = 31 * result + (message != null ? message.hashCode() : 0);
        result = 31 * result + (success != null ? success.hashCode() : 0);
        result = 31 * result + (serverSparkVersion != null ? serverSparkVersion.hashCode() : 0);
        return result;
    }
}
